To begin with, legalistic is not the same as law-abiding. To be law-abiding means obeying just laws – and even unjust ones, provided they do not require doing something wrong in itself, if disobeying would be too socially disruptive. But to be legalistic means – something else. What?
The first volume ("Christian Moral Principles") of The Way of the Lord Jesus, the three-volume magnum opus of the American moral theologian and ethicist Germain Grisez, provides a helpful answer to that question. (Disclosure: Grisez is a friend with whom I've collaborated on several books.)
For various reasons, he explains, legalism was prevalent in moral theology from the 16th century Council of Trent up to Vatican Council II (1962-65). A legalist, he writes, "tends to think of moral norms as if they were merely a body of rules." One result of that, he says, can be seen in "the suggestion that the Church might or should change its moral teaching, as if it were changeable law rather than unchangeable truth."
Then came Vatican II, whose document on the training of priests calls for a reform of moral theology. Taught "in the light of faith, under the guidance of the magisterium of the Church," it says, moral theology should be more Christocentric, should "draw more fully on the teaching of holy Scripture" and should show the duty of Christians "to bring forth fruit in charity for the life of the world" (Optatam Totius, 16).
Since the council, many theologians have worked hard at this. Some unfortunately have not. Instead, they have treated doctrines – the Church's teachings on matters of sexuality are a good example – as if they were rules, rather than understanding them as moral truths. On that basis, they have urged either changing the rules or else simply ignoring them in light of private discernment and, it seems, something akin to individual illumination by the Holy Spirit.
It's a curious fact, as Grisez remarks, that this version of a new moral theology is in its own way "as legalistic as the old." Typically, it devotes much time and effort to "trying to lessen the obligations of Christian life….Doing as one pleases is then called 'following one's conscience.'"